<!-- include tpl=head title=购物车 -->
<script type="text/javascript">
function cart_checkout()
{
	var id = $.checkbox.join();
	if(!id){
		$.dialog.alert('未指定要结算的产品');
		return false;
	}
	return true;
}
</script>
<div class="main">
	<form method="post" action="{url ctrl=cart func=checkout/}" class="am-form" onsubmit="return cart_checkout()">
	<ul class="am-list">
		<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
		<li class="am-g am-list-item-desced am-list-item-thumbed am-list-item-thumb-left">
			<div class="am-u-sm-4 am-list-thumb">
				<label>
				<img src="{$value.thumb ? $value.thumb : 'images/nopic.png'}" width="80px" border="0" alt="{$value.title}" />
				<input type="checkbox" name="id[]" id="id_{$value.id}" value="{$value.id}" checked onchange="$.cart.price()" class="cart_checkbox" />
				</label>
			</div>
			<div class=" am-u-sm-8 am-list-main">
				<!-- if $value.tid -->
				<a href="{url id=$value.tid/}"><h3 class="am-list-item-hd" id="title_{$value.id}">{$value.title}</h3></a>
				<!-- else -->
				<h2 class="am-list-item-hd" id="title_{$value.id}">{$value.title}</h2>
				<!-- /if -->
				<div class="cart_note">
					<!-- loop from=$value._attrlist key=$k value=$v id=$tmpid -->
					<div>{$v.title}：{$v.content}</div>
					<!-- /loop -->
					<div>单价：{func price_format $value.price $value.currency_id}</div>
					<ul class="cart_price_setting clearfix">
						<li class="minus" onclick="$.cart.minus({$value.id})"><i class="am-icon-minus am-icon-sm"></i></li>
						<li><input type="number" class="qty am-text-center" min="1" name="qty_{$value.id}" id="qty_{$value.id}" value="{$value.qty}" onchange="$.cart.update('{$value.id}')" /></li>
						<li class="plus" onclick="$.cart.plus({$value.id})"><i class="am-icon-plus am-icon-sm"></i></li>
					</ul>
					<div>价格：<span class="am-text-danger">{func price_format $value.price*$value.qty $value.currency_id}</span></div>
				</div>
			</div>
		</li>
		<!-- /loop -->
		<li class="am-text-right">当前选中的产品价格是：<span class="am-text-danger" id="total_price">{$price}</span></li>
	</ul>

	
	<div class="am-g">
		<div class="am-u-sm-12">
			<div class="am-btn-group">
				<input type="button" value="全选" onclick="$.checkbox.all();$.cart.price()" class="am-btn am-btn-default am-btn-xs" />
				<input type="button" value="全不选" onclick="$.checkbox.none();$.cart.price()" class="am-btn am-btn-default am-btn-xs" />
				<input type="button" value="反选" onclick="$.checkbox.anti();$.cart.price()" class="am-btn am-btn-default am-btn-xs" />
			</div>
			<input type="button" value="批量删除" onclick="$.cart.del()" class="am-btn am-btn-danger am-btn-xs am-fr" />
		</div>
		<div class="am-u-sm-12 mtop am-text-right">
			<button type="submit" class="am-btn am-btn-primary am-btn-lg">
				去结算
				<span class="am-icon-angle-double-right"></span>
			</button>
		</div>
	</div>
	</form>
</div>
<!-- include tpl=footer -->